package com.andreas.serviceImp;

import com.andreas.mapper.CategoryMapper;
import com.andreas.pojo.Category;
import com.andreas.service.CategoryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author andreaszhou
 * @ClassName CategoryServiceImp
 * @Description TODO
 * @date 2021/1/19 18:59
 * @Version 1.0
 */
@Service
@Transactional(propagation = Propagation.NOT_SUPPORTED,readOnly = true)
public class CategoryServiceImp implements CategoryService {
    @Resource
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> showCategoryService() {
        /**
         * @Author: andreaszhou
         * @Description: 查看所有图书的分类
         * @DateTime: 2021/1/19 19:06
         * @Params: []
         * @Return java.util.List<com.andreas.pojo.Category> 图书分类List
         */
        QueryWrapper<Category> queryWrapper = new QueryWrapper<>();
        List<Category> categories = categoryMapper.selectList(queryWrapper);
        return categories;
    }
}
